#include <QGLWidget>
#include <QMouseEvent>
#include "ntpg.h"

class MyGLDrawer : public QGLWidget
{
	Q_OBJECT        // must include this if you use Qt signals/slots

public:
	MyGLDrawer(QWidget *parent);
	~MyGLDrawer();

protected:

	virtual void initializeGL();
	virtual void resizeGL(int w, int h);
	virtual void paintGL();
	void mousePressEvent(QMouseEvent *event);
	void mouseMoveEvent(QMouseEvent *event);
	void mouseDoubleClickEvent(QMouseEvent *event);

	void initPhotogram();
	ntpg *solver;

private:
	void draw();
	void drawAxes();
	void drawObjectPoints();
	void drawImagePoints(uint m);
	void drawCamera(uint k);
	void drawImage(uint m);

	GLfloat rotX;
	GLfloat rotY;
	GLfloat rotZ;

	GLfloat rng;

	QPoint lastPos;

};
